import {ref} from "vue";

export interface INextGrade {
    score: number
    zy: number
    yd: number
    xz: number
    zh: number
    xlsc: number
}

export function useNextGrade() {
    const reach = ref<string>('')
    const not_reach = ref<string>('')

    reach.value = '/assets/已达成.png'
    not_reach.value = '/assets/未达成.png';

    function reach_select(isReach: boolean): string {
        return isReach ? reach.value : not_reach.value
    }

    function plan(grade: number, score: number): number {
        return Math.ceil(score / (grade * 5) * 100)
    }

    function isSuccess(grade: number, score: number) {
        return Math.ceil(score / (grade * 5) * 100) >= 100 ? "success" : "exception"
    }

    return {
        reach_select, plan, isSuccess
    }

}